package team.archai.nexus.boot.platform.basics.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;

/**
 * @program: tiny-dust-boot-build
 * @description: 基础树实体
 * @author: lishibin
 * @create: 2020-11-01 12:21
 **/
@Getter
@Setter
@Schema(description = "基础树形结构")
public class BasicsTreeVO<T> implements Serializable {

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "基础树主键形结构")
    private Long id;
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "父id")
    private Long parentId;
    @Schema(description = "级别")
    private Integer level;
    @Schema(description = "子元素")
    private List<T> children;

    @Override
    public String toString() {
        return "BasicsTreeVO{" +
                "id=" + id +
                ", parentId=" + parentId +
                ", level=" + level +
                ", children=" + children +
                '}';
    }
}
